package br.com.firula.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;
import org.springframework.beans.factory.annotation.Autowired;

import br.com.firula.bo.GolBO;
import br.com.firula.to.GolTO;
import br.com.firula.to.BaseTO;
import br.com.firula.web.filter.Filtro;

public class GolAction  extends GenericAction{

	private static final long serialVersionUID = -11105595311416759L;

	HttpServletResponse response;
	HttpServletRequest request;

	private GolBO mgrGol;

	@Autowired
    public void setGolBO(GolBO GolBO) {
        this.mgrGol = GolBO;
    }

	public String list(){
		this.request = ServletActionContext.getRequest();
		this.response = ServletActionContext.getResponse();

		GolTO gol = new GolTO();
		Filtro golFiltro = new Filtro();
		golFiltro.setClazz(GolTO.class);
		golFiltro.setExample(gol);
		request.setAttribute("golList", mgrGol.getList(golFiltro));
		return "listAdm";
	}

	@Override
	protected BaseTO getNew() {
		return null;
	}

}
